package com.itheima.mapper;

import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface GroupSetmealMapper {
    /**
     * 根据检查组查询套餐
     * @return
     */
    @Select("select setmeal_id from t_setmeal_checkgroup where checkgroup_id = #{id}")
    List<Integer> GetByGroupId(@Param("id") Long id);

    /**
     * 添加数据
     * @param id
     */
    @Insert("insert into t_setmeal_checkgroup (setmeal_id, checkgroup_id) values (#{id},#{groupId})")
    void insert(@Param("id") Integer id,@Param("groupId") Integer groupId);

    /**
     * 根据套餐ID删除数据
     * @param setmealId
     */
    @Delete("delete from t_setmeal_checkgroup where setmeal_id = #{setmealId}")
    void deleteBySetmeal(Integer setmealId);
}
